package de.koller.oceanFramework.util;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class Stat {
	private Map<String,Double> values = new HashMap<>();
	private Map<String,Double> multiplies = new HashMap<>();

	public Stat() {
		clear();
	}

	public final void clear() {
		valuesClear();
		multipliesClear();
	}

	public void valuesClear() {
		values.clear();
		values.put( "Base", 0d );
	}

	public void multipliesClear() {
		multiplies.clear();
		multiplies.put( "Base", 1d );
	}

	public Map<String, Double> getMultiplies() {
		return multiplies;
	}

	public Map<String, Double> getValues() {
		return values;
	}

	public double value() {
		double vs = 0;
		double ms = 0;

		for( Iterator<Double> i = values.values().iterator(); i.hasNext(); )
			vs += i.next();
		for( Iterator<Double> i = multiplies.values().iterator(); i.hasNext(); )
			ms += i.next();

		return vs * ms;
	}

	public float valueF() {
		return (float)value();
	}
	
}
